Skip to content

test: lock down WeakDataset json round-trip (paired with PyAutoArray fix) - #555

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/weak-dataset-from-json
May 28, 2026
Merged

test: lock down WeakDataset json round-trip (paired with PyAutoArray fix)#555
Jammy2211 merged 1 commit into
mainfrom
feature/weak-dataset-from-json

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Adds a regression test that exercises the full al.output_to_jsonal.from_json round-trip for WeakDataset. The original failure (surfaced in PR #525 / workspace #188) was a TypeError: VectorYX2DIrregular.__init__() missing 1 required positional argument: 'values' raised inside dictable.from_dict. The library-side fix lives in PyAutoArray; this PR locks down the end-to-end behaviour at the WeakDataset level, including subclass preservation (loaded.shear_yx comes back as ShearYX2DIrregular, not the base class).

Paired with: PyAutoLabs/PyAutoArray#342
Closes #554.

API Changes

None — test-only change. See full details below.

Test Plan

  • test_autolens/weak/test_dataset.py::test__weak_dataset__json_round_trip passes locally
  • Full test_autolens/weak/ suite passes locally (27 tests)
  • CI may fail until the paired PyAutoArray PR ships a release; the test passes against the worktree's PyAutoArray.
Full API Changes (for automation & release notes)

None — test-only change.

🤖 Generated with Claude Code

Regression test for the failure mode that surfaced in PR #525 — al.from_json
on a serialised WeakDataset previously crashed with:

    TypeError: VectorYX2DIrregular.__init__() missing 1 required
    positional argument: 'values'

The library-side fix lives in PyAutoArray (a `values` property on
VectorYX2DIrregular). This test asserts the full simulator → write → load
path, including subclass preservation — loaded.shear_yx returns as
ShearYX2DIrregular, not the base class — plus matching shear values, grid
positions, and noise map.

Refs issue #554.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Workspace PR: PyAutoLabs/autolens_workspace#212

@Jammy2211
Jammy2211 merged commit 1ec7390 into main May 28, 2026
6 of 8 checks passed
@Jammy2211
Jammy2211 deleted the feature/weak-dataset-from-json branch May 28, 2026 11:01
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: WeakDataset / ShearYX2DIrregular round-trip via al.from_json

1 participant